package com.deruan.hotcore.resource.model;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import net.fortuna.ical4j.model.ResourceList;

import org.columba.core.config.DefaultConfigDirectory;

import com.deruan.hotcore.base.common.bean.ResourceBean;
import com.deruan.hotcore.contact.folder.XmlDataStorage;

public class TestResourceModel 
{
	public static void main(String[] args) 
	{
		String dir = DefaultConfigDirectory.getInstance().getCurrentPath()+ "/addressbook/" + "resource";
        System.out.println(dir);
        ResourceModel model = new ResourceModel("cvs_message_cmbchina_com");
        model.setSortString("111");
        for(int i=0; i<10; i++)
        {
        	ResourceBean res = new ResourceBean();
            res.setId(i);
            res.setFrom("ningning");
            res.setPublicDate(new Date());
            res.setNote("I have a golden mine");
            res.setTitle("Golden Mime");
            model.addResource(res);
        }
        XmlDataStorage dataStorage = new XmlDataStorage();
        dataStorage.saveContactResource(dir, model.getModelId(), model);    
	}

}
